Replace values in XML files using PowerShell while preserving special characters and preventing encoding errors.